using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;

public struct AStarNode : IComponentData {
	public int index;
	public int parentIndex;

	public int x;
	public int y;

	public bool isWalkable;

	public int gCost;
	public int hCost;
	public int fCost;

	public float leftDisance;
	public float rightDistance;
	public float upDistance;
	public float downDistance;

	public float lUdistance;
	public float rUdistance;
	public float lDdistance;
	public float rDdistance;

	public void GetfCost() {
		this.fCost = gCost + hCost;
	}

	public void GethCost(int x, int y) {
		this.hCost = math.abs(this.x - x) + math.abs(this.y - y);
	}
}

public struct AStarMap : IComponentData {
	public NativeArray<AStarNode> nodes;
}
